//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml.Drawing
{
    class Relation: IOfficeXmlSerializable
    {
        private Ext? _ext;
        private string _idsrc;
        private string _iddest;
        private string _idcntr;
        internal const string xmlName = "rel";

        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read(xmlName))
            {
                _ext = c.GetOptionalEnum<Ext>(VmlConstants.VmlNamespace + "ext");
                _idsrc = c.GetOptionalString("idsrc");
                _iddest = c.GetOptionalString("iddest");
                _idcntr = c.GetOptionalString("idcntr");

            }
        }

        public void WriteXml(WriteContext context)
        {
            using (var c = context.Write(xmlName))
            {
                c.SetOptionalEnum<Ext>(VmlConstants.VmlNamespace + "ext", _ext);
                c.SetOptionalString("idsrc", _idsrc);
                c.SetOptionalString("iddest", _iddest);
                c.SetOptionalString("idcntr", _idcntr);

            }
        }
    }
}
